#dashboard-user_settings-tab
  - disable_edit = !policy(@project).update_account?
  = simple_form_for @project, defaults: {input_html: {disabled: disable_edit }, wrapper: :one_col, validation_text: false, label_wrapper_html: { class: 'w-col w-col-5 w-sub-col' } }, html: { id: 'project_account_form', class: 'w-form project-form' } do |f|
    = hidden_field_tag :anchor, 'user_settings'
    = f.simple_fields_for :account do |form|
      .w-section.section
        .w-container
          .w-col.w-col-10.w-col-push-1
            = @project.display_errors(:user_settings)
            - if disable_edit
              .card.u-radius.card-message.u-marginbottom-20
                .fontsize-small
                  = t('.account_edit_disabled_html', link: (link_to 'entrar em contato conosco'," #{CatarseSettings[:zendesk_url]}/account/dropboxes/#{CatarseSettings[:zendesk_dropbox_id]}", class: 'alt-link zendesk_widget' ))
            .w-form.card.card-terciary
              #email-form
                .fontsize-base.fontweight-semibold= t('.title') 
                .fontsize-small.u-marginbottom-20= t('.user_data_subtitle_html') 
                .w-row
                  .w-col.w-col-6.w-sub-col
                    = form.input_field :entity_type, as: :select, collection: ['Pessoa Física', 'Pessoa Jurídica'], class: 'w-select positive account_type', include_blank: false
                  .w-col.w-col-6
                .divider.u-marginbottom-20
                .w-row
                  .w-col.w-col-6.w-sub-col
                    = form.hidden_field :project_id, value: @project.id
                    = form.input :owner_name, as: :string, input_html: { class: 'positive', data: {natural: t('.natural'), juridical: t('.juridical') } }
                  .w-col.w-col-6
                    = form.input :email, as: :string, 
                    input_html: { class: 'positive' }
                .w-row
                  .w-col.w-col-6.w-sub-col
                    = form.input :owner_document, as: :tel, 
                      input_html: { class: 'positive user-document', data: { :'validate-cpf-cnpj' => true, natural: t('.owner_document_natural'), juridical: t('.owner_document_juridical')}}
                  .w-col.w-col-6
                    = form.input :state_inscription, as: :string, 
                    input_html: { class: 'positive' }
                .w-row
                  .w-col.w-col-6.w-sub-col
                    = form.input :bank_id, as: :select, collection: Bank.to_collection, class: 'w-select positive', 
                    input_html: { class: 'positive' }
                  .w-col.w-col-6
                    .w-row
                      .w-col.w-col-6.w-col-small-6.w-col-tiny-6.w-sub-col-middle
                        = form.input :agency, as: :string, 
                        input_html: { class: 'positive' }
                      .w-col.w-col-6.w-col-small-6.w-col-tiny-6.w-sub-col-middle
                        = form.input :agency_digit, as: :string, 
                        input_html: { class: 'positive' }
                .w-row.u-marginbottom-20
                  .w-col.w-col-6
                      .w-col.w-col-6.w-col-small-6.w-col-tiny-6.w-sub-col-middle
                        = form.input :account, as: :string, 
                        input_html: { class: 'positive' }
                      .w-col.w-col-6.w-col-small-6.w-col-tiny-6.w-sub-col-middle
                        = form.input :account_digit, as: :string, 
                        input_html: { class: 'positive' }
                  .w-col.w-col-6
                    = form.input :account_type, as: :string, class: 'positive',
                      input_html: { class: 'positive', readonly: true, value: 'Só aceitamos conta corrente' },
                      include_blank: true
                .fontsize-base.fontweight-semibold Endereço
                .divider.u-marginbottom-20
                .w-row
                  .w-col.w-col-6.w-sub-col
                    = form.input :address_street, as: :string, label: 'Rua',
                    input_html: { class: 'positive' }
                  .w-col.w-col-6
                    .w-row
                      .w-col.w-col-6.w-col-small-6.w-col-tiny-6.w-sub-col-middle
                        = form.input :address_number, as: :string, 
                        input_html: { class: 'positive' }
                      .w-col.w-col-6.w-col-small-6.w-col-tiny-6
                        = form.input :address_complement, as: :string, 
                        input_html: { class: 'positive', required: false }
                .w-row
                  .w-col.w-col-6.w-sub-col
                    = form.input :address_neighbourhood, as: :string, 
                    input_html: { class: 'positive' }
                  .w-col.w-col-6
                    = form.input :address_city, as: :string, 
                    input_html: { class: 'positive' }
                .w-row
                  .w-col.w-col-6.w-sub-col
                    = form.input :address_state, as: :select, collection: State.array, class: 'w-select positive', 
                    input_html: { class: 'positive' }
                  .w-col.w-col-6
                    .w-row
                      .w-col.w-col-6.w-col-small-6.w-col-tiny-6.w-sub-col-middle
                        = form.input :address_zip_code, as: :string, 
                        input_html: { class: 'positive' }
                      .w-col.w-col-6.w-col-small-6.w-col-tiny-6
                        = form.input :phone_number, as: :string, 
                        input_html: { class: 'positive' }
            .w-form.card.card-terciary
              .divider.u-marginbottom-20
              
        div
          .w-container
            .w-row
              .w-col.w-col-4.w-col-push-4
                = form.button :submit, t('.submit'),  class:'btn btn-large'
